Class sjl.PriorityQueue
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sjl.PriorityQueue

java.lang.Object
   |
   +----sjl.PriorityQueue

public class PriorityQueue
extends Object
PriorityQueue is a container adapter where the element immediatly available for retrival is the largest of those in the sequence. The container that can be turned into a PriorityQueue must implement the BackInsertContainer interface. Currently Vector and Deque can be used as containers for a PriorityQueue.

Copyright © 1996 Finn Bock

See Also:
Vector, Deque

Constructor Index

 o PriorityQueue(BackInsertContainer, Predicate2)
Construct a new PriorityQueue based on the container argument.

Method Index

 o empty()
Returns true if the queue does not contain any elements.
 o equals(Object)
Compare the elements in this container with the elements in another container.
 o pop()
Removes the top element on the queue.
 o push(Object)
Insert a new element on the top of the PriorityQueue.
 o size()
Returns the number of elements stored in the vector.
 o top()
Returns top element on the queue.

Constructors

 o PriorityQueue
  public PriorityQueue(BackInsertContainer container,
                       Predicate2 pred)
Construct a new PriorityQueue based on the container argument.

Methods

 o equals
  public boolean equals(Object container)
Compare the elements in this container with the elements in another container.
Returns:
true is the elements match.
Overrides:
equals in class Object
 o size
  public int size()
Returns the number of elements stored in the vector.
 o empty
  public boolean empty()
Returns true if the queue does not contain any elements.
 o top
  public Object top()
Returns top element on the queue.
 o pop
  public void pop()
Removes the top element on the queue.
 o push
  public void push(Object o)
Insert a new element on the top of the PriorityQueue.

All Packages  Class Hierarchy  This Package  Previous  Next  Index